#ifndef ARPREQUSTSENDER_H
#define ARPREQUSTSENDER_H

#include "arp_types.h"
#include <common.h>
#include <pcap.h>
#include <QObject>
#include <QThread>
#include <QTimer>


class ArpRequstSender : public QThread
{
    Q_OBJECT
  public:
    explicit ArpRequstSender(pcap_t* handle, std::shared_ptr<EthDev> eth_dev, QObject* parent = nullptr);
    ~ArpRequstSender();

  protected:

  signals:
  private:
    void send_arp(pcap_t* handle, uint8_t* src_mac, uint8_t* src_ip, uint8_t* dst_ip);
  private slots:
    void onTimeout();

  private:
    QTimer                  timer_;
    pcap_t*                 handle_ { nullptr };
    std::shared_ptr<EthDev> eth_dev_;
};

#endif  // ARPREQUSTSENDER_H
